﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PolygonDetails.aspx.cs" Inherits="IGIS.Extensions.polygons.PolygonDetails" %>

<!DOCTYPE html>


<html>
<head id="Head1" runat="server">
    <link href="../CSS/smoothness/jquery-ui-1.8.7.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Script/JScript.js" type="text/javascript"></script>

    <script src="../../MgExtensions/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../../MgExtensions/Scripts/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>

    <script src="../../MgExtensions/Scripts/jquery.ui.datepicker-he.js" type="text/javascript"></script>

    <style type="text/css">
		body
		{
			overflow-x:hidden;
		}
        div.my
        {
            width: 100%;
            margin: 0px;
            padding: 0px;
            margin: 0px;
        }
        image
        {
            cursor: pointer;
        }
        .ui-datepicker-trigger
        {
            cursor: pointer;
            float: left;
            display: inline;
            width: 16px;
            height: 16px;
            margin-left: 20px;
        }
    </style>
    <title>Untitled Page</title>

    <script language="javascript" type="text/javascript">
	<!--
    var LayoutID = -1;

    $(function () {
        $("input.datepicker").datepicker({
            showOn: "button",
            buttonImage: "../images/calendar.jpg",
            buttonImageOnly: true,
            autoSize: false,
            dateFormat: "dd/mm/yy"
        });
    });
    function onload() {
        if (document.getElementById("DetailsView1").innerText == '')
            AddNew.style.display = '';
        else
            if (document.getElementById("DetailsView2").innerText == '')
                AddContact.style.display = '';
    }

    function showcontact(ct) {

        switch (ct) {
            case 1:
                window.navigate('Contacts.aspx?LayoutID=' + LayoutID + '&KeverID=' + document.all("Kever_ID").value + '&contact=&#1511;&#1512;&#1493;&#1489; &#1502;&#1513;&#1508;&#1495;&#1492;');
                break;
            case 2:
                window.navigate('Contacts.aspx?LayoutID=' + LayoutID + '&KeverID=' + document.all("Kever_ID").value + '&contact=&#1489;&#1493;&#1504;&#1492; &#1502;&#1510;&#1489;&#1492;');
                break;
            case 3:
                window.navigate('Contacts.aspx?LayoutID=' + LayoutID + '&KeverID=' + document.all("Kever_ID").value + '&contact=&#1512;&#1489;');
                break;
            default:
                alert('');
        }
    }

    function showhide(what) {
        var vc = document.getElementById(what)
        if (vc.style.display == "none")
            vc.style.display = "";
        else
            vc.style.display = "none";

        document.getElementById("txtDisplayVCard").value = vc.style.display;
    }

    function displaycontact() {
        try {
            document.getElementById('vcard').style.display = document.getElementById('txtDisplayVCard').value;
            clearTimeout(T);
        } catch (err) {
            T = setTimeout("displaycontact()", "500");
        }
    }
    //-->
    </script>

    <meta content="text/html; charset=windows-1250" http-equiv="Content-Type">
    <meta http-equiv="PRAGMA" content="NO-CACHE">
</head>
<body onload="onload()" class="index" dir="rtl" style="font-size: 10px; font-family: Arial, 'Arial (Hebrew)', Aharoni, 'Courier New';
    margin: 0; padding: 0px; margin-right: 0px">
    <form id="Form1" method="post" runat="server" style="margin: 0px">
    <div style="background: #dcdcdc; border-bottom: solid 1px red; height: 60; font-size: 16pt;
        color: navy; width: 275px; padding: 0px; margin-right: 0px" align="center">
        &#1499;&#1512;&#1496;&#1497;&#1505; &#1502;&#1497;&#1491;&#1506;<br />
        &#1495;&#1500;&#1511;&#1514; &#1511;&#1489;&#1512;</div>
    <div style="width: 275px; text-align: right" align="center">
       </div>
    <div style="width: 275px; text-align: right" align="center">
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
            DataKeyNames="fldID" CellPadding="2" AllowPaging="True" GridLines="None" Height="100%"
            FieldHeaderStyle-Font-Names="Arial" Width="100%" ForeColor="#333333" Font-Size="12px">
            <FooterStyle BackColor="#990000" ForeColor="White" Font-Bold="True" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" Font-Size="12px" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <Fields>
                <asp:BoundField DataField="fldID" HeaderText="&#1511;&#1493;&#1491; &#1500;&#1511;&#1493;&#1495;" ReadOnly="True" Visible="False" />
                <asp:BoundField DataField="CustomerID" HeaderText="&#1502;&#1505;&#1508;&#1512; &#1514;.&#1494;." />
                <asp:BoundField DataField="FK_KEVER" HeaderText="&#1502;&#1505;&#1508;&#1512; &#1511;&#1489;&#1512;" />
                <asp:TemplateField HeaderText="&#1505;&#1496;&#1496;&#1493;&#1505;">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlStatus1" runat="server" AutoPostBack="True" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlStatus2" runat="server" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("fldDesc") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&#1513;&#1501; &#1508;&#1512;&#1496;&#1497;">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtFName" runat="server" Text='<%# Bind("FName") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFName"
                            ErrorMessage="&#1495;&#1493;&#1489;&#1492;"></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="txtFName" runat="server" Text='<%# Bind("FName") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFName"
                            ErrorMessage="&#1495;&#1493;&#1489;&#1492;"></asp:RequiredFieldValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("FName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&#1513;&#1501; &#1502;&#1513;&#1508;&#1495;&#1492;">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtLName" runat="server" Text='<%# Bind("LName") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtLName"
                            ErrorMessage="&#1495;&#1493;&#1489;&#1492;"></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="txtLName" runat="server" Text='<%# Bind("LName") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtLName"
                            ErrorMessage="&#1495;&#1493;&#1489;&#1492;"></asp:RequiredFieldValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("LName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&#1497;&#1513;&#1493;&#1489;">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlYeshov1" runat="server" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlYeshov3" runat="server" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("SHEM_YESHUV") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Address" HeaderText="&#1512;&#1495;' &#1493;&#1502;&#1505;' &#1489;&#1497;&#1514;" />
                <asp:BoundField DataField="zip" HeaderText="&#1502;&#1497;&#1511;&#1493;&#1491;" />
                <asp:BoundField DataField="dtBirth" HeaderText="&#1514;&#1488;&#1512;&#1497;&#1498; &#1500;&#1497;&#1491;&#1492;" ControlStyle-CssClass="datepicker" />
                <asp:BoundField DataField="dtPaste" HeaderText="&#1514;&#1488;&#1512;&#1497;&#1498; &#1508;&#1496;&#1497;&#1512;&#1492;" ControlStyle-CssClass="datepicker" />
                <asp:TemplateField HeaderText="&#1488;&#1497;&#1513; &#1511;&#1513;&#1512;">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlIshKesher1" runat="server" Width="165px" />
                        <img src='../Images/contact.jpg' align='absmiddle' onclick="showhide('vcard')" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlIshKesher1" runat="server" Width="165px" />
                        <img src='../Images/contact.jpg' align='absmiddle' onclick="showhide('vcard')" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblcn1" runat="server" Text='<%# Bind("cn1") %>'></asp:Label>
                        <img src='../Images/contact.jpg' align='absmiddle' onclick="showhide('vcard')" />
                    </ItemTemplate>
                    <ItemStyle Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&#1514;&#1488;&#1493;&#1512; &#1511;&#1513;&#1512;">
                    <EditItemTemplate>
                        <asp:DropDownList ID="Contact1Type1" runat="server" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="Contact1Type2" runat="server" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("Contact1Type") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<a href='javascript: showcontact(2)'>&#1489;&#1493;&#1504;&#1492; &#1502;&#1510;&#1489;&#1492;</a>">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlBoneMazeva1" runat="server" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlBoneMazeva2" runat="server" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label44" runat="server" Text='<%# Bind("cn2") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<a href='javascript: showcontact(3)'>&#1512;&#1489;</a>">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlRav1" runat="server" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlRav2" runat="server" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label55" runat="server" Text='<%# Bind("cn3") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&#1514;&#1488;&#1512;&#1497;&#1498; &#1512;&#1499;&#1497;&#1513;&#1492;">
                    <InsertItemTemplate>
                        <asp:TextBox ID="dtREHISHA1" runat="server" />
                    </InsertItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="dtREHISHA2" runat="server" Text='<%# Bind("dtREHISHA") %>' CssClass="datepicker" /><br />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblDtRehisha" runat="server" Text='<%# Bind("dtREHISHA") %>' CssClass="datepicker" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="dtGILOUIMAZEVA" HeaderText="&#1514;. &#1490;&#1497;&#1500;&#1493;&#1497; &#1502;&#1510;&#1489;&#1492;" ControlStyle-CssClass="datepicker" />
                <asp:BoundField DataField="Price" HeaderText="&#1502;&#1495;&#1497;&#1512;" DataFormatString="{0:F2} &#1513;''&#1495;" />
                <asp:BoundField DataField="PaymentType" HeaderText="&#1492;&#1506;&#1512;&#1514; &#1514;&#1513;&#1500;&#1493;&#1501;" />
                <asp:TemplateField HeaderText="&#1514;&#1513;&#1500;&#1493;&#1501;">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddlPayment1" runat="server">
                            <asp:ListItem Value="" Text=""></asp:ListItem>
                            <asp:ListItem Value="&#1502;&#1494;&#1493;&#1502;&#1503;" Text="&#1502;&#1494;&#1493;&#1502;&#1503;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1502;&#1495;&#1488;&#1492;" Text="&#1492;&#1502;&#1495;&#1488;&#1492;"></asp:ListItem>
                            <asp:ListItem Value="&#1488;&#1513;&#1512;&#1488;&#1497;" Text="&#1488;&#1513;&#1512;&#1488;&#1497;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1506;&#1489;&#1512;&#1492; &#1489;&#1504;&#1511;&#1488;&#1497;&#1514;" Text="&#1492;&#1506;&#1489;&#1512;&#1492; &#1489;&#1504;&#1511;&#1488;&#1497;&#1514;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1493;&#1512;&#1488;&#1514; &#1511;&#1489;&#1506;" Text="&#1492;&#1493;&#1512;&#1488;&#1514; &#1511;&#1489;&#1506;"></asp:ListItem>
                            <asp:ListItem Value="&#1488;&#1495;&#1512;" Text="&#1488;&#1495;&#1512;"></asp:ListItem>
                        </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="ddlPayment2" runat="server">
                            <asp:ListItem Value="" Text="&#1502;&#1494;&#1493;&#1502;&#1503;"></asp:ListItem>
                            <asp:ListItem Value="&#1502;&#1494;&#1493;&#1502;&#1503;" Text="&#1502;&#1494;&#1493;&#1502;&#1503;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1502;&#1495;&#1488;&#1492;" Text="&#1492;&#1502;&#1495;&#1488;&#1492;"></asp:ListItem>
                            <asp:ListItem Value="&#1488;&#1513;&#1512;&#1488;&#1497;" Text="&#1488;&#1513;&#1512;&#1488;&#1497;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1506;&#1489;&#1512;&#1492; &#1489;&#1504;&#1511;&#1488;&#1497;&#1514;" Text="&#1492;&#1506;&#1489;&#1512;&#1492; &#1489;&#1504;&#1511;&#1488;&#1497;&#1514;"></asp:ListItem>
                            <asp:ListItem Value="&#1492;&#1493;&#1512;&#1488;&#1514; &#1511;&#1489;&#1506;" Text="&#1492;&#1493;&#1512;&#1488;&#1514; &#1511;&#1489;&#1506;"></asp:ListItem>
                            <asp:ListItem Value="&#1488;&#1495;&#1512;" Text="&#1488;&#1495;&#1512;"></asp:ListItem>
                        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Payment") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Commants" HeaderText="&#1492;&#1506;&#1512;&#1492;" />
                <asp:BoundField DataField="dtPayPeraoon" HeaderText="&#1514;&#1488;&#1512;&#1497;&#1498; &#1508;&#1512;&#1506;&#1493;&#1503;" ControlStyle-CssClass="datepicker" />
                <asp:CommandField ButtonType="Button" CancelText="&#1489;&#1497;&#1496;&#1493;&#1500;" DeleteText="&#1502;&#1495;&#1497;&#1511;&#1492;" EditText="&#1506;&#1491;&#1499;&#1493;&#1503;"
                    InsertText="&#1492;&#1493;&#1505;&#1508;&#1492;" NewText="&#1495;&#1491;&#1513;" SelectText="&#1489;&#1495;&#1497;&#1512;&#1492;" ShowEditButton="True" UpdateText="&#1488;&#1497;&#1513;&#1493;&#1512;" />
            </Fields>
            <FieldHeaderStyle Font-Names="Arial" BackColor="#FFFFFF" Font-Bold="true" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
            <CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
        </asp:DetailsView>
        <br />
      <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IGISConnectionString %>"
            SelectCommand="SELECT DISTINCT fldID, CustomerID, FK_KEVER, FName, LName, Address, City, zip, dtBirth, dtPaste, Contact1, Contact1Type, Contact2, Contact3, dtREHISHA, dtGILOUIMAZEVA, Price, Payment, PaymentType, Commants, dtPayPeraoon, LU_Status, BetkevarotID FROM _CUSTOMERS WHERE (FK_KEVER = @FK_KEVER)"
            UpdateCommand="update _CUSTOMERS set Commants='' where fldid=-1">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="-1" Name="FK_KEVER" QueryStringField="KeverID"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:IGISConnectionString %>"
            SelectCommand="SELECT [FName], [LName] FROM [_CUSTOMERS] WHERE ([FK_KEVER] = @FK_KEVER)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="-1" Name="FK_KEVER" QueryStringField="FK_KEVER"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    <!-- Add New Kever Dtl -->
    <div id="AddNew" style="display: none; width: 275px; text-align: center; font-size: 14px"
        align="center">
        &#1508;&#1512;&#1496;&#1497; &#1511;&#1489;&#1512; &#1494;&#1492; &#1500;&#1488; &#1504;&#1502;&#1510;&#1488;&#1493; &#1489;&#1502;&#1506;&#1512;&#1499;&#1514; -
        sp:Button ID="Button2" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="&#1489;&#1497;&#1496;&#1493;&#1500;" />
                    plate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:IGISConnectionString %>"
            SelectCommand="SELECT     A.fldID, A.FNAME, A.LNAME, A.Address, A.City, A.Email, A.PH1, A.PH2, A.COMMENTS FROM   _CONTACT AS A INNER JOIN _CUSTOMERS AS B ON A.fldID = B.Contact1 WHERE     (B.FK_KEVER = @KeverID)"
            UpdateCommand="update _CONTACT set LNAME='' WHERE ([fldID] = -1)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="1149" Name="KeverID" QueryStringField="KeverID"
                    Type="Double" />
            </SelectParameters>
        </asp:SqlDataSource>
        <!-- Add New Contact -->
        <div id="AddContact" style="display: none; width: 275px; text-align: center; font-size: 14px"
            align="center">
            לא נימצא איש קשר במערכת<br />
            האם ברצונך להוסיף איש קשר חדש<br />
            <br />
            <asp:Button ID="Button3" runat="server" Text="אישור" OnClick="AddNewContact" />
        </div>
    </div>
    <!-- Hidden Fields -->
    <asp:HiddenField ID="txtDisplayVCard" runat="server" Value="none" />
    <asp:HiddenField ID="hfLayoutID" runat="server" />
    <input type="hidden" value='<%= Request["KeverID"]%>' id="Kever_ID">
    </form>
</body>
</html>
